package com.github.maojx0630.onebot;

import com.github.maojx0630.onebot.monitor.MonitorFactory;
import com.github.maojx0630.onebot.socket.OneBotWebSocketHandler;
import com.github.maojx0630.onebot.ws.QqBotMessageHandle;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 毛家兴
 * @since 2024-04-11 14:39
 **/
@Configuration
public class OneBotConfiguration {

  @Bean
  public MonitorFactory monitorFactory() {
    return new MonitorFactory();
  }

  @Bean
  public QqBotMessageHandle qqBotMessageHandle(MonitorFactory monitorFactory) {
    return new QqBotMessageHandle(monitorFactory);
  }

  @Bean
  public OneBotWebSocketHandler oneBotWebSocketHandler(QqBotMessageHandle handle) {
    return new OneBotWebSocketHandler(handle);
  }
}
